//
//  ARLikeAnimation.m
//  AriseSamePro
//
//  Created by 包日守 on 15/10/24.
//  Copyright © 2015年 Arise. All rights reserved.
//

#import "ARLikeAnimation.h"

@interface ARLikeAnimation ()

@end

@implementation ARLikeAnimation

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/


- (id) initWithFrame:(CGRect)frame
{

    self = [super initWithFrame:frame];
    if (self) {
        self.frame = CGRectMake(-11, -11, 42, 42);
        NSMutableArray *marray = [NSMutableArray array];
        
        
        for (int i = 1; i < 16; i ++) {
            
            UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"love%04d",i]];
            
           // NSLog(@"%@",[NSString stringWithFormat:@"love%04d",i]);
            [marray addObject:image];
            
        }
        
        self.animationImages = marray;
        self.animationDuration = 0.5;
        self.animationRepeatCount = 1;
        
        
        
    }
    return self;
}

- (void) willMoveToSuperview:(UIView *)newSuperview
{
    [super willMoveToSuperview:newSuperview];
    self.frame = CGRectMake(-11, -11, 42, 42);
    //NSLog(@"%@",NSStringFromCGRect(newSuperview.bounds));
    
    
    [self startAnimating];
    

}


@end
